//
//  TypeSubCell.m
//  LiWuShuo
//
//  Created by 袁小航 on 14/11/14.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "TypeSubCell.h"
#import "Define.h"
#import "TypeSubCollectionCell.h"
#import "TypePHCollectioCell.h"

@implementation TypeSubCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
//        创建一个topCollectionView
        [self createTopicCollectionView];
    }
    return self;
}
#pragma mark - 创建一个topCollectionView
- (void)createTopicCollectionView
{
    self.topicLayout = [[UICollectionViewFlowLayout alloc]init];
    _topicLayout.itemSize = CGSizeMake(TYPE_TOPIC_WIDTH, TYPE_TOPIC_HEIGHT);
    _topicLayout.sectionInset = UIEdgeInsetsMake(10, 20, 10, 20);
    
    self.topicCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, 320, 240) collectionViewLayout:_topicLayout];
    _topicCollectionView.scrollEnabled = NO;
    _topicCollectionView.backgroundColor = [UIColor whiteColor];
    
    [self.topicCollectionView registerClass:[TypeSubCollectionCell class] forCellWithReuseIdentifier:@"topicCell"];
    [self.topicCollectionView registerClass:[TypePHCollectioCell class] forCellWithReuseIdentifier:@"personCell"];
    [self.topicCollectionView registerClass:[TypePHCollectioCell class] forCellWithReuseIdentifier:@"hobbyCell"];
    
    
    [self.contentView addSubview:_topicCollectionView];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
